package com.jdym.back.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jdym.R;
import com.jdym.back.entity.Loan;
import com.jdym.back.entity.Pv;
import com.jdym.back.service.PvService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/back/pv")
public class PvController {

    @Autowired
    PvService pvService;
    //    按时间统计贷款的数量
    @GetMapping("/selectPv/{start}/{end}")
    public R selectPv(@PathVariable String start, @PathVariable String end){
        System.out.println("时间："+start);
//      List<Pv> Pv= pvService.getBaseMapper().selectList(new QueryWrapper<Pv>().between("pvtime",start,end));
      List<Pv> Pv=pvService.selectPv(start,end);
        return R.ok().data("pv",Pv);
    }
}
